<extend name="Base/base"/>
<block name="title">{$title}</block>
<block name="content">
    <div class="main-title">
        <h2>修改服务</h2>
    </div>
    <form  class="form-horizontal" id="saveform" action="{:U('edit')}" enctype="multipart/form-data" method="post">
        <div class="form-item">
            <label class="item-label">服务类型名称<span class="check-tips">（用于后台显示的服务名称）</span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="name" value="{$data.name}" id="name">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">排序<span class="check-tips">（用于服务产品的顺序）</span></label>
            <div class="controls">
                <input type="text" class="text input-small" name="sort" value="{$data.sort|default=0}">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">更多内容<span class="check-tips">("更多"内容显示)</span></label>
            <div class="controls">
                <textarea name="contact">{$data.contact}</textarea>
                <!--<input type="text" class="text input-large" name="contact" value="{$info.url|default=''}">-->
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">标题图片<span class="check-tips">(服务图片-首页显示）</span></label>
            <div class="controls">
               <img src="{$data.thumb}">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">图片库<span class="check-tips">(服务的图片库）</span></label>
            <div class="controls">
                <!--
              <foreach name="{$data.images}" item="images">
                  <img src="$images">
                  </foreach>
                -->
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">是否隐藏<span class="check-tips"></span></label>
            <div class="controls">
                <label class="radio"><input type="radio" name="hide" value="1" <if condition="$data['hide'] eq 1" > checked </if>>是</label>
                <label class="radio"><input type="radio" name="hide" value="0" <if condition="$data['hide'] eq 0" > checked </if>>否</label>
            </div>
        </div>

        <div class="form-item">
            <label class="item-label">备注<span class="check-tips">（其他说明）</span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="desc" value="{$data.desc|default=''}">
            </div>
        </div>
        <div class="form-item">
        
            <button class="btn btn-return" onclick="javascript:history.back(-1);
                    return false;">返 回</button>
        </div>
    </form>
</block>

<block name="script">
    <script type="text/javascript">
        Think.setValue("pid", {$info.pid | default = 0});
                Think.setValue("hide", {$info.hide | default = 0});
                Think.setValue("is_dev", {$info.is_dev | default = 0});
                Think.setValue("is_active", {$info.is_active | default = 0});
                //导航高亮
                highlight_subnav('{:U('index')}');
                jQuery(document).ready(function () {
//            $("#submit").click(function () {
//
//                if ($("#name").val() == "") {
//                    alert("服务名称不可为空");
//                } else if ($("#contact").val() == "") {
//                    alert("更多内容不可为空");
//                } else if ($("#thumb").val() == "") {
//                    alert("标题图片不可为空");
//                } else if ($("#images").val() == "") {
//                    alert("标题图片库不可为空");
//                } else {
//                    ajaxPostSubmit($(this));
//                }
//
//            })
        })

    </script>

</block>